﻿@using Library
@model Ecommerce.Models.EditSpecificationGroupViewModel

@using (Ajax.BeginForm("EditSpecificationGroup", "Admin",
    new AjaxOptions
    {
        HttpMethod = "POST",
        AllowCache = false,
        UpdateTargetId = "formctnr",
        InsertionMode = InsertionMode.Replace,
        OnSuccess = "onSuccess"
    }, new { @id = "specification-group-form", @class = "form-horizontal", @data_modelid = (ViewBag.IsEdit ? Model.Id.ToString() : "-1"), @data_action = "EditSpecificationGroup", @data_refid = Model.ProductCategoryId }))
{
    <div class="modal-body">
        @Html.AntiForgeryToken()
        @if (ViewBag.IsEdit)
        {
            @Html.HiddenFor(m => m.Id)
        }
        @Html.HiddenFor(m => m.Culture)
        @Html.HiddenFor(m => m.ProductCategoryId)
        <div class="form-group">
            <label class="col-sm-2 control-label">@NOWCulture.GetString("Specification group name")</label>
            <div class="col-sm-10">
                @Html.TextBoxFor(m => m.Name, new { @class = "form-control", @autofocus = "" })
                @Html.ValidationMessageFor(m => m.Name, "", new { @class = "text-danger" })
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">@NOWCulture.GetString("Description")</label>
            <div class="col-sm-10">
                @Html.TextBoxFor(m => m.Description, new { @class = "form-control" })
                @Html.ValidationMessageFor(m => m.Description, "", new { @class = "text-danger" })
            </div>
        </div>
        @Html.ValidationSummary(true, "", new { @class = "bg-danger" })
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">@NOWCulture.GetString("Close")</button>
        <input type="submit" class="btn btn-primary" value="@NOWCulture.GetString("Save")">
    </div>
    @Scripts.Render("~/Scripts/admin.edit.specification-group.js")
}